
<template tag="以下文档内容为hycli自动生成">
  <div>
   
    <!-- 验证发布 -->
    <el-dialog v-model="conf.anz_visible" 
        draggable
      title="验证发布" :close-on-click-modal="false"  width="60%"
      top="10vh" 
      :before-close="hide_anz">
    <el-form  ref="fm_anz" :model="form_anz" :rules="rules_anz">
    <el-row>
    <el-col :span="12">
     <!--已验证 下拉控件 -->
    <el-form-item prop="is_verified" label="已验证" label-width="100px" label-position="right">
      <el-select   v-model="form_anz.is_verified" style="width: 100%" filterable clearable
        placeholder="请选择已验证" >
        <el-option v-for="item in is_verifiedList" :key="item.value" :label="item.name" :value="item.value" />
      </el-select>
    </el-form-item>
    </el-col>
    <el-col :span="12">
     <!--已发布 下拉控件 -->
    <el-form-item prop="is_published" label="已发布" label-width="100px" label-position="right">
      <el-select   v-model="form_anz.is_published" style="width: 100%" filterable clearable
        placeholder="请选择已发布" >
        <el-option v-for="item in is_publishedList" :key="item.value" :label="item.name" :value="item.value" />
      </el-select>
    </el-form-item>
    </el-col>
    </el-row>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="hide_anz" icon="close">取消</el-button>
        <el-button type="primary" @click="save_anz" icon="select">提交</el-button>
      </span>
    </template>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data(){
    return{
      conf:{
        anz_visible:false,//验证发布
      },
      form_anz:{},//验证发布
      //验证发布
      rules_anz:{ 
        is_verified:[{required:true, message:"请输入已验证", trigger: 'blur'}], 
        is_published:[{required:true, message:"请输入已发布", trigger: 'blur'}],
      },
    }
  },
  methods:{
     //--------------------验证发布---------------------------------
      //显示 验证发布 弹出框
      show_anz(fm){
        //处理输入参数
        let currentForm = {}
        Object.assign(this.form_anz,currentForm)
        this.form_anz.is_verified = fm.is_verified
        this.form_anz.is_published = fm.is_published
        //特殊参数处理
        // this.form_anz.id = (this.bcheck||[]).join(",")
        this.loadEnums_anz()
        this.conf.anz_visible = true;
      },

      //隐藏 验证发布 弹出框
      hide_anz(){
        this.conf.anz_visible = false;
        this.$refs.fm_anz.resetFields();
      },

      //保存 验证发布 弹出框数据
      save_anz(){
        let that = this
        this.$refs.fm_anz.validate((v=>{
          if(!v) return
          let post_form_anz = this.form_anz
          this.$theia.http.post("/ws/bug/collection/finish",post_form_anz).then(res=>{
            that.$notify.success({title: '成功',message: '提交成功',duration:5000})
            that.$emit("onsaved")
            that.hide_anz()
          }).catch(res=>{
            let code = ((res||{}).response||{}).status||0
            let msg= `提交失败(${code})`
            that.$notify.error({title: '失败',message:msg,duration:5000})
          })
      }))
    },
    //验证发布
    loadEnums_anz(){
        //已验证
        this.is_verifiedList = this.$theia.enum.get("bool","","" ,false,"")
        //已发布
        this.is_publishedList = this.$theia.enum.get("bool","","" ,false,"")
    },

  },
}
</script>
<style scoped>
.form_item_info{
  margin-left: 4px;
  color:#999;
}
.form_item_info:hover{
  cursor: pointer;
  font-weight: 500;
  color:#333;
}
</style>